package cn.zongjie.day05;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;
import java.util.Date;
import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第1个生日:(yyyy年MM月dd日)");
        String brith1 = sc.next();
        System.out.println("请输入第2个生日:(yyyy年MM月dd日)");
        String brith2 = sc.next();

        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
        LocalDate ldt1 = LocalDate.parse(brith1, dtf);
        LocalDate ldt2 = LocalDate.parse(brith2, dtf);
        if (ldt1.isAfter(ldt2)) {
            System.out.println("第1个生日的人年龄更小一些");
        } else {
            System.out.println("第2个生日的人年龄更小一些");
        }
        // LocalDate ld8 = LocalDate.of(2001, 12, 12);
        // LocalDate ld9 = LocalDate.of(2099, 12, 12);
        // System.out.println(ld8.equals(ld9));// false
        // System.out.println(ld8.isAfter(ld9)); // false
        // System.out.println(ld8.isBefore(ld9)); // false

    }
}
